<div class="box">
<%= form_for @user_session, :url => casein_user_session_path do |f| %>

  <div class="head">
           <h3>Login</h3>
  </div>
  <div class="main">
	<% if @user_session.errors.any? %>
		<div class="error">
			<p>
				<% @user_session.errors.keys.each do |key| %>
					<%= (key.to_s.humanize + " ") unless key == :base %>
					<%=  @user_session.errors[key].first %>
				<% end %>
			</p>
		</div>
	<% end %>

	<% if flash[:warning] %>
		<div class="error">
			<p><%= flash[:warning] %></p>
		</div>
	<% end %>

	<% if flash[:notice] %>
		<div class="notice">
			<p><%= flash[:notice] %></p>
		</div>
	<% end %>
    <div class="table">
    <table>
      <tr>
        <td><%= f.label :login, "Username" %></td>
      </tr>
      <tr>
		<td><%= f.text_field :login, :class => "caseinTextField" %></td>
      </tr>
      <tr>
		<td><%= f.label :password, "Password" %> </td>
      </tr>
      <tr>
		<td><%= f.password_field :password, :class => "caseinTextField" %></td>
      </tr>
      <tr>
          <td>
            <div class="submit_remember">
              <p>
                <%= f.check_box :remember_me %> Remember me
                <br /><br />
                <%= f.submit "Log in", :class => "caseinSubmit" %>
                <input type="button" value="Forgotten password?" class="caseinSubmitBlue" onclick="toggleDiv('recover');" />
              </p>
            </div>
          </td>
      </tr>
    </table>

<% end %>

<%= form_tag casein_password_reset_url do %>
	<div id="recover">
	<table>
      <tr>
        <td><%= label_tag :recover_email, "Email:" %></td>
      </tr>
      <tr>
        <td><%= text_field_tag :recover_email, params[:recover_email], :class => "caseinTextField" %></td>
      </tr>
      <tr>
        <td><%= submit_tag "Reset", :class => "caseinSubmit" %></td>
      </tr>
	</table>


	</div>
    </div>
</div>
<% end %>
</div>